.class public Lcom/estrongs/android/ui/notification/b$a;
.super Landroid/content/BroadcastReceiver;
.source "ChromeCastPlayerNotificationHelper.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/estrongs/android/ui/notification/b;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "a"
.end annotation


# instance fields
.field a:Lcom/estrongs/chromecast/ChromeCastManager;


# direct methods
.method public constructor <init>()V
    .locals 1

    .line 1
    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    .line 2
    invoke-static {}, Lcom/estrongs/chromecast/ChromeCastManager;->getInstance()Lcom/estrongs/chromecast/ChromeCastManager;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/ui/notification/b$a;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    return-void
.end method


# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 6

    .line 1
    invoke-static {}, Lcom/estrongs/android/ui/notification/b;->k()Lcom/estrongs/android/ui/notification/b;

    move-result-object p1

    invoke-static {p1}, Lcom/estrongs/android/ui/notification/b;->a(Lcom/estrongs/android/ui/notification/b;)Lcom/estrongs/android/ui/notification/b;

    .line 2
    :try_start_0
    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object p1

    const-string p2, "com.estrongs.action.chromecast.control.preview"

    .line 3
    invoke-virtual {p1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_0

    .line 4
    iget-object p1, p0, Lcom/estrongs/android/ui/notification/b$a;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {p1}, Lcom/estrongs/chromecast/ChromeCastManager;->getMediaStreamPosition()J

    move-result-wide p1

    const-wide/16 v0, 0x1388

    sub-long/2addr p1, v0

    .line 5
    iget-object v0, p0, Lcom/estrongs/android/ui/notification/b$a;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {v0, p1, p2}, Lcom/estrongs/chromecast/ChromeCastManager;->mediaSeek(J)V

    .line 6
    invoke-static {}, Lcom/estrongs/android/ui/notification/b;->j()Lcom/estrongs/android/ui/notification/b;

    move-result-object p1

    invoke-virtual {p1}, Lcom/estrongs/android/ui/notification/b;->i()V

    goto/16 :goto_2

    :cond_0
    const-string p2, "com.estrongs.action.chromecast.control.next"

    .line 7
    invoke-virtual {p1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_1

    .line 8
    iget-object p1, p0, Lcom/estrongs/android/ui/notification/b$a;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {p1}, Lcom/estrongs/chromecast/ChromeCastManager;->getMediaStreamPosition()J

    move-result-wide p1

    const-wide/16 v0, 0x3a98

    add-long/2addr p1, v0

    .line 9
    iget-object v0, p0, Lcom/estrongs/android/ui/notification/b$a;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {v0, p1, p2}, Lcom/estrongs/chromecast/ChromeCastManager;->mediaSeek(J)V

    .line 10
    invoke-static {}, Lcom/estrongs/android/ui/notification/b;->j()Lcom/estrongs/android/ui/notification/b;

    move-result-object p1

    invoke-virtual {p1}, Lcom/estrongs/android/ui/notification/b;->i()V

    goto/16 :goto_2

    :cond_1
    const-string p2, "com.estrongs.action.chromecast.control.close"

    .line 11
    invoke-virtual {p1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_2

    .line 12
    invoke-static {}, Lcom/estrongs/android/ui/notification/b;->j()Lcom/estrongs/android/ui/notification/b;

    move-result-object p1

    invoke-static {p1}, Lcom/estrongs/android/ui/notification/b;->b(Lcom/estrongs/android/ui/notification/b;)Lcom/estrongs/android/ui/notification/c;

    move-result-object p1

    if-eqz p1, :cond_8

    .line 13
    invoke-static {}, Lcom/estrongs/android/ui/notification/b;->j()Lcom/estrongs/android/ui/notification/b;

    move-result-object p1

    invoke-static {p1}, Lcom/estrongs/android/ui/notification/b;->b(Lcom/estrongs/android/ui/notification/b;)Lcom/estrongs/android/ui/notification/c;

    move-result-object p1

    invoke-virtual {p1}, Lcom/estrongs/android/ui/notification/c;->a()V

    goto/16 :goto_2

    :cond_2
    const-string p2, "com.estrongs.action.chromecast.control.play"

    .line 14
    invoke-virtual {p1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_7

    .line 15
    iget-object p1, p0, Lcom/estrongs/android/ui/notification/b$a;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {p1}, Lcom/estrongs/chromecast/ChromeCastManager;->getMediaPlayerState()I

    move-result p1

    const/4 p2, 0x2

    if-ne p1, p2, :cond_3

    .line 16
    iget-object p1, p0, Lcom/estrongs/android/ui/notification/b$a;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {p1}, Lcom/estrongs/chromecast/ChromeCastManager;->mediaPause()V

    goto :goto_1

    .line 17
    :cond_3
    iget-object p1, p0, Lcom/estrongs/android/ui/notification/b$a;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {p1}, Lcom/estrongs/chromecast/ChromeCastManager;->getCurrentMediaInfo()Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;

    move-result-object p1

    if-nez p1, :cond_4

    return-void

    .line 18
    :cond_4
    iget-object p2, p0, Lcom/estrongs/android/ui/notification/b$a;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {p2}, Lcom/estrongs/chromecast/ChromeCastManager;->getMediaPlayerState()I

    move-result p2

    const/4 v0, 0x1

    if-eq p2, v0, :cond_6

    iget-object p2, p0, Lcom/estrongs/android/ui/notification/b$a;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    .line 19
    invoke-virtual {p2}, Lcom/estrongs/chromecast/ChromeCastManager;->getMediaPlayerState()I

    move-result p2

    if-nez p2, :cond_5

    goto :goto_0

    .line 20
    :cond_5
    iget-object p1, p0, Lcom/estrongs/android/ui/notification/b$a;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {p1}, Lcom/estrongs/chromecast/ChromeCastManager;->mediaPlay()V

    goto :goto_1

    .line 21
    :cond_6
    :goto_0
    iget-object v0, p0, Lcom/estrongs/android/ui/notification/b$a;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    iget-object v1, p1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->oriPath:Ljava/lang/String;

    iget-object v2, p1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->url:Ljava/lang/String;

    iget-object v3, p1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->name:Ljava/lang/String;

    iget-object v4, p1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->mimeType:Ljava/lang/String;

    iget-object p1, p0, Lcom/estrongs/android/ui/notification/b$a;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {p1}, Lcom/estrongs/chromecast/ChromeCastManager;->getCurrentPlayListController()Les/uo;

    move-result-object v5

    invoke-virtual/range {v0 .. v5}, Lcom/estrongs/chromecast/ChromeCastManager;->loadMedia(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Les/uo;)V

    .line 22
    :goto_1
    invoke-static {}, Lcom/estrongs/android/ui/notification/b;->j()Lcom/estrongs/android/ui/notification/b;

    move-result-object p1

    invoke-virtual {p1}, Lcom/estrongs/android/ui/notification/b;->i()V

    goto :goto_2

    :cond_7
    const-string p2, "com.estrongs.action.chromecast.control.disconnect"

    .line 23
    invoke-virtual {p1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_8

    .line 24
    iget-object p1, p0, Lcom/estrongs/android/ui/notification/b$a;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {p1}, Lcom/estrongs/chromecast/ChromeCastManager;->disconnect()V

    .line 25
    invoke-static {}, Lcom/estrongs/android/ui/notification/b;->j()Lcom/estrongs/android/ui/notification/b;

    move-result-object p1

    invoke-static {p1}, Lcom/estrongs/android/ui/notification/b;->b(Lcom/estrongs/android/ui/notification/b;)Lcom/estrongs/android/ui/notification/c;

    move-result-object p1

    if-eqz p1, :cond_8

    .line 26
    invoke-static {}, Lcom/estrongs/android/ui/notification/b;->j()Lcom/estrongs/android/ui/notification/b;

    move-result-object p1

    invoke-static {p1}, Lcom/estrongs/android/ui/notification/b;->b(Lcom/estrongs/android/ui/notification/b;)Lcom/estrongs/android/ui/notification/c;

    move-result-object p1

    invoke-virtual {p1}, Lcom/estrongs/android/ui/notification/c;->a()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_2

    :catch_0
    move-exception p1

    .line 27
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    :cond_8
    :goto_2
    return-void
.end method
